﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Brain;
namespace AvaProvi
{
    public partial class ctlAnalisisCapitalizacion : AvaProvi.ControlBase
    {
        VSimbolo vs;
        //Validadora val;
        public ctlAnalisisCapitalizacion()
            : base()
        {
            InitializeComponent();
            ActualizaPanel();
        }

        public override void ActualizaDatos()
        {
            clsAvaluo_CRN.AvaluoActual.Guardar();
            this.ActualizaPanel();
        }

        public override void ActualizaPanel()
        {
            this.bsTerreno.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.Terreno;
            this.bsAnalisis.DataSource = clsAvaluo_CRN.AvaluoActual.Inmueble.Terreno.AnalisisCapRentas;
            this.bsAnalisis.ResetBindings(false);
            this.bsTerreno.ResetBindings(false);
        }

        private void btnVer_Click(object sender, EventArgs e)
        {
            frmVerLink objVer = new frmVerLink();
            objVer.ShowDialog();
        }

        private void superficieDeConstruccionesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (superficieDeConstruccionesTextBox.Text).Trim());
        }

        private void superficieAccesoriaTotalTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (superficieAccesoriaTotalTextBox.Text).Trim());
        }

        private void sumaDeSuperficiesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (sumaDeSuperficiesTextBox.Text).Trim());
        }

        private void valorHomologadoDeRentasAplicableTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (valorHomologadoDeRentasAplicableTextBox.Text).Trim());
        }

        private void supAccesoriaRentaM2TextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (supAccesoriaRentaM2TextBox.Text).Trim());
        }

        private void supConstRentaMensualTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (supConstRentaMensualTextBox.Text).Trim());
        }

        private void supAccesoriaRentaMensualTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (supAccesoriaRentaMensualTextBox.Text).Trim());
        }

        private void txtSumaRentasMensuales_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (txtSumaRentasMensuales.Text).Trim());
        }

        private void montoAdministracionTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoAdministracionTextBox.Text).Trim());
        }

        private void montoConservacionTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoConservacionTextBox.Text).Trim());
        }

        private void montoPredialTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoPredialTextBox.Text).Trim());
        }

        private void montoSeguroTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoSeguroTextBox.Text).Trim());
        }

        private void montoDepreciacionFiscalTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoDepreciacionFiscalTextBox.Text).Trim());
        }

        private void sumaDeduccionesFiscalesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (sumaDeduccionesFiscalesTextBox.Text).Trim());
        }

        private void montoDeduccionOpcionalTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoDeduccionOpcionalTextBox.Text).Trim());
        }

        private void deduccionMayorTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (deduccionMayorTextBox.Text).Trim());
        }

        private void utilidadAntesDeImpuestosTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (utilidadAntesDeImpuestosTextBox.Text).Trim());
        }

        private void montoISRTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoISRTextBox.Text).Trim());
        }

        private void montoPTUTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (montoPTUTextBox.Text).Trim());
        }

        private void sumaDeDeduccionesTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (sumaDeDeduccionesTextBox.Text).Trim());
        }

        private void anioActualTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (anioActualTextBox.Text).Trim());
        }

        private void anioAnteriorTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            vs = new VSimbolo();
            e.Handled = vs.esDecimal(e.KeyChar, (anioAnteriorTextBox.Text).Trim());
        }
    }
}
